import request from '@/utils/request'
export function getTagList(data: {
  pageNum: number
  pageSize: number
  data: { labelName: string; labelType: number; showDetail: boolean }
}) {
  return request({
    url: `/nlp/label/mgmt/query`,
    method: 'POST',
    data,
  })
}

export function addTag(data: { labelName: string; labelType: number; mappingCharList?: {}[] }) {
  return request({
    url: `/nlp/label/mgmt/add`,
    method: 'post',
    data,
  })
}
export function getList(data: {
  dictionaryLabelName?: string
  dictionaryLabelNameStrict?: string
  dictionaryLabelId?: string
}) {
  return request({
    url: `/nlp/dictionary/label/list`,
    method: 'post',
    data,
  })
}
export function editTag(data: { labelName: string; labelType: number; mappingCharList?: {}[] }) {
  return request({
    url: `/nlp/label/mgmt/edit`,
    method: 'post',
    data,
  })
}

//删除标签
export function deleteTag(data: { ids: string }) {
  return request({
    url: `/nlp/label/mgmt/delete`,
    method: 'post',
    data: { ids: [data.ids] },
  })
}
//配置查询
export function getTagConfigList(data: { id: string }) {
  return request({
    url: `/nlp/label/mgmt/config/query`,
    method: 'get',
    params: data,
  })
}
//配置保存接口
export function saveConfig(data: {
  mappingId: string
  logicChar: number
  expressionType: number
  expressionValue: string
  id: string
}) {
  return request({
    url: `nlp/label/mgmt/config/save`,
    method: 'post',
    data,
  })
}
//配置删除接口
export function deleteConfig(data: { ids: string[] }) {
  return request({
    url: `nlp/label/mgmt/config/delete`,
    method: 'post',
    data,
  })
}
//实体类型配置测试接口
export function testConfig(data: { ids: string[]; content: string }) {
  return request({
    url: `nlp/label/mgmt/config/test`,
    method: 'post',
    data,
  })
}
